import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import path from 'path'

export default defineConfig({
  base: './',
  plugins: [
    vue(),
    vueJsx(), //插件使用
  ],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src")
    }
  },
  server: {
    proxy: { // 配置域名代理
      "/sapi": {
        target: "https://fangyi.kaizhuoyun.com/sapi",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/sapi/, ""),
      },
    },
  },
})